package com.shop.common.enums.user;

import lombok.Getter;

/**
 * 审核状态
 */
@Getter
public enum AuditStatusEnum {

    NORMAL(0, "待审核"),
    ADMIN_LOCK(1, "审核通过"),
    PASSWORD_ERROR_LOCK(-1, "审核未通过")
    ;

    private int code;
    private String msg;

    AuditStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static AuditStatusEnum val(int code) {
        for (AuditStatusEnum enumObj: AuditStatusEnum.values()) {
            if(enumObj.code == code) {
                return enumObj;
            }
        }
        return null;
    }
}
